package com.robam.cloud.authcenter.event;

import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


/**
 * @author zhanggj
 */
public class EventUtil {

    static EventBus eventBus;

    public static void initAsync() {
        ExecutorService threadPool = Executors.newCachedThreadPool();
        eventBus = new AsyncEventBus(threadPool);
        eventBus.register(new EventListener());
    }

    public static EventBus getEventBus() {
        return eventBus;
    }

}
